package com.yongcheon.sms_manager.ui.sms_spam.actionTab;

import android.app.ActionBar;

import com.yongcheon.sms_manager.data.contract.ContactData;
import com.yongcheon.sms_manager.data.sms_spam.AbstractSMSData;

/**
 * Created by yongcheon on 2014-11-18.
 */
public class ActionTabSMSService {
    AbstractSMSData smsData;
    ContactData contactData;

    public void setSMSService(AbstractSMSData smsData){
        this.smsData = smsData;
    }
    public void setContactData(ContactData contactData){
        this.contactData = contactData;
    }

    public void createActionTab( ActionBar ab, String tabName){
        ActionBar.Tab tab = ab.newTab();
        tab.setText(tabName);
        ActionTabSMSFragment frag = ActionTabSMSFragment.newInstance(tabName);
        frag.setSMSService(smsData);
        frag.setContactData(contactData);
        tab.setTabListener(new ActionTabSMSListener(frag));
        ab.addTab(tab);
    }
}
